<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="Content-Script-Type" content="text/javascript" />
		<meta http-equiv="Content-Style-Type" content="text/css" />
		<title>コントロールパネル</title>
		<link rel="stylesheet" href="./assets/styles/default.css" type="text/css" />
		<link rel="stylesheet" href="./assets/styles/ui-lightness/ui.all.css" type="text/css" />
		<link rel="stylesheet" href="./assets/styles/ui-lightness/jquery-ui-1.7.3.custom.css" type="text/css" />
		<link rel="stylesheet" href="./assets/styles/dialog.css" type="text/css" />
		<script src="assets/scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
		<script src="assets/scripts/jquery-ui-1.7.3.custom.min.js" type="text/javascript"></script>
		<script src="assets/scripts/ui/ui.dialog.js" type="text/javascript"></script>
		<script src="assets/scripts/menu.js" type="text/javascript"></script>
		<script src="assets/scripts/table.js" type="text/javascript"></script>
		<script type="text/javascript" src="./tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
		<script type="text/javascript" src="./assets/scripts/editor.js"></script>
		<script type="text/javascript" src="./assets/scripts/ui/ui.datepicker.js"></script>
		<script type="text/javascript" src="./assets/scripts/ui/ui.core.js"></script>
		<script type="text/javascript" src="./assets/scripts/jquery.tablednd_0_5.js"></script>
		<script type="text/javascript" src="./assets/scripts/search.js"></script>
		<script type="text/javascript">
		$(function() {
			$('.message').fadeIn("slow");

			
			$('.btn_update').click(function(){
				if( confirm('更新してよろしいですか？') ){
					document.fm.mode.value = 'input';
					document.fm.submit();
				}
			});
			$('#year4').change(function(){
				var year4 = this.value;
				var myDate = new Date();
				var nowtime =  myDate.getTime();
					
				$.get("mmap_week_ajax.php",{ y: year4,t : nowtime }, function(data){
					$("#matrix_cd1").children().remove();
					$("#matrix_cd1").append( data );
					
					$("#matrix_cd2").children().remove();
					$("#matrix_cd2").append( data );
					
					$("#matrix_cd3").children().remove();
					$("#matrix_cd3").append( data );
					
					$("#matrix_cd4").children().remove();
					$("#matrix_cd4").append( data );
					
				});
			});
			

			
		});

		</script>
		
	</head>
	<body id="">
{{ $menu }}
{{ $logout }}
		<div id="container"><div class="wrapper">
						<h2>年末年始サマリマスター管理</h2>
			<ul class="submenu clearfix">
				<li><a href="mnewyear_index.php">年末年始サマリ情報一覧</a></li>
				<li><a href="mnewyear_form.php">年末年始サマリ情報登録</a></li>
				<li>週名設定</li>
			</ul>
			<h3>年末年始週名情報更新{{ if $phase == 'complete' }}完了{{ /if }}</h3>
{{ if $phase == 'input' }}
	<p class="message">内容を確認し、更新ボタンをクリックしてください。</p>
	<form name="fm" action="mnewyear_week_form.php" method="post">
		<table class="formTable">
			<tbody>
				<tr>
					<th>更新日</th>
					<td>
						{{ $forms.u_time }}<input type="hidden" name="u_time" value="{{ $forms.u_time }}" />
					</td>
				</tr>
				<tr>
					<th>更新者</th>
					<td>
						{{ $forms.m_user_name }}<input type="hidden" name="m_user_name" value="{{ $forms.m_user_name }}" />
					</td>
				</tr>
				<tr>
					<th>ID</th>
					<td>{{ $forms.id }}</td>
				</tr>
				<tr><th>年度</th>
				<td>
				{{ html_options id='year4' name='year4' options=$year4 selected=$forms.year4 }} 年{{ $err.year4 }}
				</td></tr>
				<tr><th>告知チラシ週名1</th><td>
				{{ html_options id='matrix_cd1' name='matrix_cd1' options=$week  selected=$forms.matrix_cd1 }}{{ $err.matrix_cd1 }} 
				<input type="hidden" name="week1"   class="text" value="{{ $forms.week1 }}" />
				</td></tr>
				<tr><th>告知チラシ週名2</th><td>
				{{ html_options id='matrix_cd2' name='matrix_cd2' options=$week  selected=$forms.matrix_cd2 }}{{ $err.matrix_cd2 }} 
				<input type="hidden" name="week2"   class="text" value="{{ $forms.week2 }}" />
				</td></tr>
				<tr><th>告知チラシ週名3</th><td>
				{{ html_options id='matrix_cd3' name='matrix_cd3' options=$week  selected=$forms.matrix_cd3 }}{{ $err.matrix_cd3 }} 
				<input type="hidden" name="week3"   class="text" value="{{ $forms.week3 }}" />
				<tr><th>告知チラシ週名4</th><td>
				{{ html_options id='matrix_cd4' name='matrix_cd4' options=$week  selected=$forms.matrix_cd4 }}{{ $err.matrix_cd4 }} 
				<input type="hidden" name="week4"   class="text" value="{{ $forms.week4 }}" />
				</td></tr>
				</td></tr>
			</tbody>
		</table>
		<p class="button">
			<button type="button" class="btn_update" class="submit"><span>更新</span></button>
		</p>
		<input type="hidden" name="id" value="{{ $forms.id }}" />
		<input type="hidden" name="mode" value="" />
	</form>

<div id="dialog" >
</div>
 <div id="dialogmuti" >
</div>
{{ /if }}
{{ if $phase == 'complete' }}
			<p class="message">{{ $message }}</p>
			<ul>
				<li>>> <a href="mnewyear_week_form.php">更新</a></li>
			</ul>
{{ /if }}

		</div></div>
		{{ $footer }}
	</body>
</html>